#include <stdio.h>
#include <iostream>

using namespace std;

void insert(int a[],int length){
	int key;
	for(int i=1; i < length; i++){
		key = a[i];
		int j = i-1;
		while(j>=0 && key < a[j]){
			a[j+1] = a[j];
			j--;
		}
		a[j+1] = key;
	}
}
int main(){
	int arr[10] = {56,389,67,34,498,23,45,67,57,457};
	insert(arr,10);
	for(int i = 0; i < 10;i++){
		cout << arr[i]<< " ";
	}
	cout << endl;
	
	return 0;
}
